var colorTr;
window.onload = function (){
    var bodyObj = document.getElementById("data");
    var trArray = bodyObj.getElementsByTagName("tr");
    for(var i=0;i<trArray.length;i++){
        trArray[i].onclick = function (){
            trClick(this);
        }
    }
}

function  trClick(trObj){
    if(colorTr != null){
        colorTr.style.backgroundColor = "white";
    }
    trObj.style.backgroundColor = "yellow";
    colorTr = trObj;
}